package com.example.assempro.api

import com.example.a_lib.http.RetrofitFactory.API_HOST_SMART_SITE_PERFIX
import com.example.a_lib.http.resp.Response
import com.example.assempro.model.HomepageIndexInfo
import com.example.assempro.model.User
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*

/**
 * Created by xiedongdong on 2021/01/19
 */
interface LoginApi {
    @Headers(API_HOST_SMART_SITE_PERFIX)
    @FormUrlEncoded
    @POST("user/login")
    fun login1(
        @Field("username") username: String,
        @Field("password") password: String
    ): Observable<Response<User>>


    @FormUrlEncoded
    @POST("user/login")
    fun login2(@FieldMap params: @JvmSuppressWildcards Map<String, Any>): Observable<Response<User>>

    @FormUrlEncoded
    @POST("user/login")
    fun login3(@Body requestBody: RequestBody): Observable<Response<User>>

}
